package com.probiz.estore.common.model.product.base;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

import com.probiz.estore.common.model.product.ProductTypeSkuOption;
import com.probiz.estore.common.model.product.SkuOptionValue;
import com.probiz.estore.core.model.BaseObject;

/**
 * SkuOption Base Java Bean, base class for the model, mapped directly to database table
 * <p/>
 * Avoid changing this file if not necessary, will be overwritten.
 */
public class SkuOptionTbl extends BaseObject implements Serializable {

    protected Integer skuOptionId;
    protected String skuOptionName;
    protected String skuOptionCode;
    protected String memo;
    protected Integer version;

    protected Set<ProductTypeSkuOption> productTypeSkuOptions = new HashSet<ProductTypeSkuOption>();
    protected Set<SkuOptionValue> skuOptionValues = new HashSet<SkuOptionValue>();

    /**
     * Default Empty Constructor for class SkuOption
     */
    public SkuOptionTbl() {
        super();
    }

    /**
     * Default Key Fields Constructor for class SkuOption
     *
     * @param in_skuOptionId 规格id
     */
    public SkuOptionTbl(Integer in_skuOptionId) {
        this.setSkuOptionId(in_skuOptionId);
    }


   


    public Set<ProductTypeSkuOption> getProductTypeSkuOptions() {
		return productTypeSkuOptions;
	}

	public void setProductTypeSkuOptions(
			Set<ProductTypeSkuOption> productTypeSkuOptions) {
		this.productTypeSkuOptions = productTypeSkuOptions;
	}

	public Set<SkuOptionValue> getSkuOptionValues() {
		return skuOptionValues;
	}

	public void setSkuOptionValues(Set<SkuOptionValue> skuOptionValues) {
		this.skuOptionValues = skuOptionValues;
	}

	/**
     * * @return Integer
     *
     * @hibernate.id column="skuOptionId" type="java.lang.Integer" generator-class="native"
     */
    public Integer getSkuOptionId() {
        return this.skuOptionId;
    }

    /**
     * Set the skuOptionId
     */
    public void setSkuOptionId(Integer aValue) {
        this.skuOptionId = aValue;
    }

    /**
     * 变种属性名称	 * @return String
     *
     * @hibernate.property column="skuOptionName" type="java.lang.String" length="64" not-null="true" unique="false"
     */
    public String getSkuOptionName() {
        return this.skuOptionName;
    }

    /**
     * Set the skuOptionName
     *
     * @spring.validator type="required"
     */
    public void setSkuOptionName(String aValue) {
        this.skuOptionName = aValue;
    }

    /**
     * 变种属性编码	 * @return String
     *
     * @hibernate.property column="skuOptionCode" type="java.lang.String" length="32" not-null="true" unique="false"
     */
    public String getSkuOptionCode() {
        return this.skuOptionCode;
    }

    /**
     * Set the skuOptionCode
     *
     * @spring.validator type="required"
     */
    public void setSkuOptionCode(String aValue) {
        this.skuOptionCode = aValue;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

   
    /**
     * * @return Integer
     *
     * @hibernate.property column="version" type="java.lang.Integer" length="10" not-null="true" unique="false"
     */
    public Integer getVersion() {
        return this.version;
    }

    /**
     * Set the version
     *
     * @spring.validator type="required"
     */
    public void setVersion(Integer aValue) {
        this.version = aValue;
    }

    /**
     * @see java.lang.Object#equals(Object)
     */
    public boolean equals(Object object) {
        if (!(object instanceof SkuOptionTbl)) {
            return false;
        }
        SkuOptionTbl rhs = (SkuOptionTbl) object;
        return new EqualsBuilder()
                .append(this.skuOptionId, rhs.skuOptionId)
                .isEquals();
    }

    /**
     * @see java.lang.Object#hashCode()
     */
    public int hashCode() {
        return new HashCodeBuilder(-82280557, -700257973)
                .append(this.skuOptionId)
                .append(this.skuOptionName)
                .append(this.skuOptionCode)
                .append(this.version)
                .toHashCode();
    }

    /**
     * @see java.lang.Object#toString()
     */
    public String toString() {
        return new ToStringBuilder(this)
                .append("skuOptionId", this.skuOptionId)
                .append("skuOptionName", this.skuOptionName)
                .append("skuOptionCode", this.skuOptionCode)
                .append("version", this.version)
                .toString();
    }

    /**
     * Return the name of the first key column
     */
    public String getFirstKeyColumnName() {
        return "skuOptionId";
	}
	
	/**
	 * Return the Id (pk) of the entity, must be Integer
	 */
	public Integer getId() {
		return skuOptionId;
	}

}